<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
        content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="true">
<title>Sample</title>
</head>
<body>
<script>
var appCache = window.applicationCache;

appCache.addEventListener('checking', cacheCheckingHandler, false);
appCache.addEventListener('noupdate', cacheNoupdateHandler, false);
appCache.addEventListener('downloading', cacheDownloadingHandler, false);
appCache.addEventListener('progress', cacheProgressHandler, false);
appCache.addEventListener('cached', cacheCachedHandler, false);
appCache.addEventListener('updateready', cacheUpdatereadyHandler, false);
appCache.addEventListener('obsolete', cacheObsoleteHandler, false);
appCache.addEventListener('error', cacheErrorHandler, false);

function cacheCheckingHandler(event) {
  alert('Checking');
}; 
function cacheNoupdateHandler(event) {
  alert('Noupdate');
}; 
function cacheDownloadingHandler(event) {
  alert('Downloading');
}; 
function cacheProgressHandler(event) {
  alert('Progress');
}; 
function cacheCachedHandler(event) {
  alert('Cached');
}; 
function cacheUpdatereadyHandler(event) {
  alert('Updateready');
}; 
function cacheObsoleteHandler(event) {
  alert('Obsolete');
}; 
function cacheErrorHandler(event) {
  alert('Error' + event.message);
};
</script>
</body>
</html>
